﻿using System;
using System.Windows.Forms;

namespace WhiteFox.DAlessio.Patterns.UI.MVC
{
    public class ViewBase<T> : Form
    {
        private static T instance;
        public static T Controller
        {
            get
            {
                if (instance == null) instance = Activator.CreateInstance<T>();
                return instance;
            }
        }

        public ViewBase()
        {
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
            this.StartPosition = FormStartPosition.CenterScreen;
        }
    }
}
